package com.yq.cns.net

import com.yq.cns.entity.ChannelEntity
import com.yq.cns.entity.NewsListEntity
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

/**
 * @author: user
 * @date: 2022/11/16
 */
interface NewsApi {
    /**
     * 获取新闻-全部频道
     */
    @GET("cns/app/v1/channel_list")
    suspend fun getChannelList(): ApiResult<List<ChannelEntity>>

    /**
     * 新闻列表接口
     */
    @GET("cns/app/v1/news_list/{cname}")
    suspend fun getNewsList(
        @Path("cname") cname: String?, @Query("pageIndex") pageIndex: Int,
        @Query("language") language: String?, @Query("userId") userId: String?
    ): ApiResult<List<NewsListEntity>>
}